package com.tide.crm.dao;

import java.util.List;
import java.util.Map;

import com.tide.crm.model.ConvergeDict;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface ConvergeDictDao {

    @Select("select * from converge_dict t where t.id = #{id}")
    ConvergeDict getById(Long id);

    @Delete("delete from converge_dict where id = #{id}")
    int delete(Long id);

    int update(ConvergeDict convergeDict);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into converge_dict(id, create_date, modify_date, dict_code, dict_name, dict_des, order_list, dict_status) values(#{id}, #{createDate}, #{modifyDate}, #{dictCode}, #{dictName}, #{dictDes}, #{orderList}, #{dictStatus})")
    int save(ConvergeDict convergeDict);
    
    int count(@Param("params") Map<String, Object> params);

    List<ConvergeDict> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
    
    public List<ConvergeDict> findDictList();

	public List<ConvergeDict> findDictListByCodes(@Param("params") Map<String, Object> params);
}
